package com.uzai.common.enums;

/**
 * 手动绑定状态
 * @author liuqi
 * @date 2021/8/27 17:19
 * @param
 * @return null
 */
public enum OrderBindStatusEnum {
    FAIL(0,"失败"),
    SUCC(1,"成功"),
    OTHER_BIND(2,"被他人绑定"),
    IN_QUEUE(3,"加入绑定队列");

    public static final int FAIL_VALUE = 0;
    public static final int SUCC_VALUE = 1;
    public static final int OTHER_BIND_VALUE = 2;
    public static final int IN_QUEUE_VALUE = 3;

    private Integer value;
    private String desc;

    OrderBindStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static OrderBindStatusEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (OrderBindStatusEnum type: OrderBindStatusEnum.values()) {
            if (type.getValue().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
